﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using zichan.BLL;
using zichan.BLL.StatisticsModel;

namespace zichan.Controllers
{
    public class APIController : Controller
    {
        // GET: API
        [HttpGet]
        public JsonResult GetIP(string Ip)
        {
            this.ControllerContext.HttpContext.Response.Headers.Add("Access-Control-Allow-Origin", "*");
            IpAPIModel model = APIService.GetIps(Ip);
            return Json(new { Ip=model.Ip, IpClass=model.IpClass, IpAdress=model.IpAdress, IsDJ=model.IsDJ}, JsonRequestBehavior.AllowGet);
            //return Json(new {data=model});
        }
    }
}